package 位运算;

import java.util.Scanner;

public class 交换奇偶位 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(Integer.toBinaryString(n));
        System.out.println(swap(n));
        System.out.println(Integer.toBinaryString(swap(n)));
    }
    static int swap(int n){
        int ou = n&0xaaaaaaaa;// 和1010 1010 1010 做与运算
        int ji = n&0x55555555;// 和0101 0101 0101 做与运算
        return (ou>>1)|(ji<<1);
    }
}
